from zope.component import getUtility
from Products.CMFCore.interfaces import IPropertiesTool

KEY = 'plone.app.multilingual.interfaces.ITranslatable'

def fti_modified(obj, event):
    """check if the multilingual behaviours"""
    ptool = getUtility(IPropertiesTool)
    multilingual_properties = ptool.get('multilingual_properties')
    if multilingual_properties:
        supported_types = multilingual_properties.supported_types
        if KEY in obj.behaviors:
            if obj.id not in supported_types:
                multilingual_properties.supported_types += (obj.id,)
        else:
            if obj.id in supported_types:
                multilingual_properties.supported_types -= (obj.id,)
                 
            
            
    
    